/**
 * Created by yuming619 on 2016/12/9.
 */
angular.module('app.auth', [])
    .config(['$stateProvider', '$urlRouterProvider', function ($stateProvider, $urlRouterProvider) {
        $stateProvider
            .state('login', {
                url: "/login",
                templateUrl: login_viewurl + "/auth/login.html",
                controller: 'LoginCtrl'
            })
    }])
    //管理员登录
    .controller('LoginCtrl', ['$scope', '$state', '$cookieStore', 'LoginService', function ($scope, $state, $cookieStore, LoginService) {

        $scope.manage = {};
        $scope.loginmanager = function (manager) {
            LoginService.login(manager, function (data) {
                $cookieStore.put("manager_cookie", data);
                $state.go('mealplan.order');
            }, function (data) {
                alert(data.data.reason);
            })
        }

    }])